import {get, post, put} from "@/utils/request";
import {AxiosPromise} from "@/types/common";


/**
 * 根据 ID 获取基类
 * @param id 基类 ID
 */
export const useBaseClassApi = (id: Number) => {
	return get('/generator/v1/baseclass/' + id)
}

/**
 * 新增或更新表单
 * @param dataForm 表单数据
 */
export const useBaseClassSubmitApi = (dataForm: any): AxiosPromise<boolean> => {
	if (dataForm.id) {
		return put('/generator/v1/baseclass', dataForm)
	} else {
		return post('/generator/v1/baseclass', dataForm)
	}
}
